﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ProjetSMA.View._2D
{
    public class Element2D
    {
        protected int m_length = 13;
        protected int m_x = 0, m_y = 0;
        protected Color m_color = System.Drawing.Color.Yellow;
        protected PictureBox m_shape;

        protected Model.Element m_element;


        public Element2D()
        {
        }

        public Element2D(Model.Element par_element)
        {
            m_element = par_element;
        }

        public Element2D(int par_l)
        {
            m_length = par_l;
        }

        public void Draw(Form par_form)
        {
            m_shape = new PictureBox();
            m_shape.Image = null;
            m_shape.Name = "";
            m_shape.Location = new Point(m_x, m_y);
            m_shape.Size = new Size(m_length, m_length);
            m_shape.BackColor = m_color;
            m_shape.Visible = true;
            par_form.Controls.Add(m_shape);
        }

      //  public DrawColor()
      //  {

      //  }

        public Model.Element ModelElement
        {
            get { return m_element; }
        }

        public int X
        {
            get { return m_x; }
            set { m_x = value; }
        }

        public int Y
        {
            get { return m_y; }
            set { m_y = value; }
        }

        public int Length
        {
            get { return m_length; }
            set { m_length = value; }
        }

        public PictureBox Shape
        {
            get { return m_shape; }
            set { m_shape = value; }
        }
    }
}
